<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<%@ include file="../../common/jsp/sheetHeader.jsp" %>
<script>
	$(document).ready(function() {
		//createSheet();
		//setInitColumns();
	});

	function createSheet() {
		createIBSheet2(document.getElementById("viewArea"),"mySheet","100%","400px");
		
		var sheet_init = {};
		sheet_init.Cfg = {FrozenCol:0,SearchMode:smLazyLoad,Page:30};
		
		var headers = [ {Text:"NO|상태|삭제|문자열|콤보|콤보에디트|팝업|팝업에디트|자동합계|자동평균|정수|실수|날짜|패스워드|체크박스|라디오|", Align:"Center"} ];
		var info = {Sort:1, ColMove:1, ColResize:1, HeaderCheck:0};
		
		mySheet.InitHeaders(headers, info);
	}
	
	/*Sheet 각종 처리*/
	function doAction(sAction) {
		
		switch(sAction) {
			case "search":		//조회
				mySheet.DoSearch("../data/sheet_data.xml");
				break;
				
			case "init":		//초기화
				mySheet.Reset();
				createSheet();
				setInitColumns();
				break;
		}
	}

	function mySheet_OnMouseDown(Button, Shift, X, Y) {
		$('#column_id').val(mySheet.MouseCol());
	}
	
	function setColumnAlign() {
		var col		= $('#column_id').val();
		var align	= $("#align option:selected").val();
		
		col = col?col:"-1";
		
		if (col > -1 && align.length) {
			var info = {Align:"" + align + ""};
			mySheet.SetColProperty(col, info);
		} else {
			alert("적용할 셀의 정보가 없습니다.");
		}
	}
	
	function setCssStyle() {
		var style = $('#styleTitle').val();
		var styles = style.split(";");
		
		for (var i = 0; i < styles.length; i++) {
			if (styles[i].indexOf(":") > -1) {
				prop = styles[i].split(":");
				$("#title").css(prop[0], prop[1]);
			}
		}
		
	}
	
</script>
<title>전체 폰트 지정 예제</title>
</head>
<body>
<div id="main">
	<%@ include file="../../common/jsp/sheetNavi.jsp" %>	
	<div id="title">전체 폰트 지정 예제</div>
	<div id="desc">
		CSS파일에서 헤더 타이틀과 시트폰트에 관련된 부분 정의
	</div>
	<!-- 
	<div align="right">
		<input type="button" value="초기화" onclick="doAction('init')">
		<input type="button" value="조회" onclick="doAction('search')">
	</div>
	-->
	<div id="functionArea">
		<div>스타일 내용<br>
&lt;style&gt;<br>
#title {
<textarea id="styleTitle" style="height:30px;width:100%;">
font-size:2.5em;
</textarea>
}
		</div>
		<input type="button" value="스타일 적용" onclick="setCssStyle()">
	</div>
	
	<div id="viewArea">
	</div>
</div>
</body>
</html>